package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

//gin框架路由组
func main(){
	engine := gin.Default()

	api := engine.Group("/api")
	{
		api.GET("/get_user", func(c *gin.Context) {
			c.String(http.StatusOK,"api get_user")
		})

		api.GET("/get_info", func(c *gin.Context) {
			c.String(http.StatusOK,"api get_info")
		})
	}

	admin := engine.Group("/admin")
	{
		admin.GET("/login", func(c *gin.Context) {
			c.String(http.StatusOK,"admin login")
		})

		admin.GET("/logout", func(c *gin.Context) {
			c.String(http.StatusOK,"admin logout")
		})
	}

	engine.Run()

}
